//
//  StudentModel3.swift
//  ArchitectGenerics
//
//  Created by 姚胜龙 on 2017/6/13.
//  Copyright © 2017年 姚胜龙. All rights reserved.
//

import UIKit

class StudentModel3: NSCopying {

    var name:String?
    var teachers:Array<TeacherModel3>?

    init(name:String, teachers:Array<TeacherModel3>) {
        self.name = name
        self.teachers = teachers
    }

    func copy(with zone: NSZone? = nil) -> Any {
        var newArray = Array<TeacherModel3>()
        for teacher in self.teachers! {
            newArray.append(teacher.copy() as! TeacherModel3)
        }
        return StudentModel3(name: self.name!, teachers: newArray)
    }
}
